package com.restaurant.application.consumption;

import com.nebutown.description.UnitDescription;
import com.nebutown.generation.basictype.UID;
import com.nebutown.generation.basictype.UIDLists;

public class ConsumptionDesc extends UnitDescription {
    public static void main(String[] args) {
        UnitDescription desc = UnitDescription.basicUnit(Consumption.class, "ConsumptionData");

        desc.nextBean("ConsumptionData")
                // 从二维火来的数据
                // 折扣
                .add("discount", UIDLists.class)
                .add("shopUID", UID.class)
                .add("shopID", String.class)
                .add("orderId", String.class)
                .add("totalPrice", Double.class)
                // 最终价格
                .add("finalPrice", Double.class)
                .add("customerName", String.class)
                .add("customer", UID.class)
                .add("weChatId", String.class)
                .add("time", Long.class)
                .add("phone", String.class)
                .add("accumulatePoints", Long.class);
        desc.nextBean("OrderData")
                // 从二维火来的数据
                .add("time", Long.class)
                .add("shopID", String.class)
                // 折扣
                .add("number", String.class)
                .add("position", String.class)
                .add("totalPrice", Double.class)
                .add("recordId", Long.class)
                .add("factPrice", Double.class);

        desc.addUiFactory("consumption", "ConsumptionData", SUBS.NONE);

        desc.run("./");
    }
}
